{% extends "base.html" %}

{% block title %}登录 - 农场{% endblock %}

{% block content %}
    <div class="max-w-md mx-auto bg-white rounded-lg shadow-md overflow-hidden">
        <div class="p-6">
            <h2 class="text-2xl font-bold mb-6 text-center">用户登录</h2>
            <form action="{{ url_for('login') }}" method="post">
                <div class="mb-4">
                    <label for="username" class="block text-gray-700 mb-2">用户名</label>
                    <input type="text" id="username" name="username" required
                           class="w-full px-3 py-2 border border-gray-300 rounded-md focus:outline-none focus:ring-2 focus:ring-blue-500">
                </div>
                <div class="mb-6">
                    <label for="password" class="block text-gray-700 mb-2">密码</label>
                    <input type="password" id="password" name="password" required
                           class="w-full px-3 py-2 border border-gray-300 rounded-md focus:outline-none focus:ring-2 focus:ring-blue-500">
                </div>
                <button type="submit" class="btn-primary w-full">
                    登录
                </button>
            </form>
            <div class="mt-4 text-center">
                <p class="text-gray-600">还没有账号？ <a href="{{ url_for('register') }}" class="text-blue-600 hover:underline">立即注册</a></p>
            </div>
        </div>
    </div>
{% endblock %}
